# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Connectors.V1.Model.AuthObject do
  @moduledoc """
  AuthObject defines a JSON schema of an authentication type.

  ## Attributes

  *   `additionalProperties` (*type:* `boolean()`, *default:* `nil`) - Whether the object has additional properties.
  *   `authKey` (*type:* `String.t`, *default:* `nil`) - Auth key of the object.
  *   `authType` (*type:* `String.t`, *default:* `nil`) - Auth type of the object.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of the object.
  *   `isDefault` (*type:* `boolean()`, *default:* `nil`) - Whether the object is the default one.
  *   `properties` (*type:* `%{optional(String.t) => GoogleApi.Connectors.V1.Model.AuthProperty.t}`, *default:* `nil`) - Properties of the object.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of the object.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :additionalProperties => boolean() | nil,
          :authKey => String.t() | nil,
          :authType => String.t() | nil,
          :description => String.t() | nil,
          :isDefault => boolean() | nil,
          :properties =>
            %{optional(String.t()) => GoogleApi.Connectors.V1.Model.AuthProperty.t()} | nil,
          :type => String.t() | nil
        }

  field(:additionalProperties)
  field(:authKey)
  field(:authType)
  field(:description)
  field(:isDefault)
  field(:properties, as: GoogleApi.Connectors.V1.Model.AuthProperty, type: :map)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Connectors.V1.Model.AuthObject do
  def decode(value, options) do
    GoogleApi.Connectors.V1.Model.AuthObject.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Connectors.V1.Model.AuthObject do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
